# -*- coding: utf-8 -*-
# @Author   : niejiali
# @Time     : 2019/2/25 10:48
# @File     : test002.py
# @Software : PyCharm


class FinishedException(Exception):
    def __init__(self,value):
            self.value=value

try:
    raise FinishedException("这个方法给出异常")
except FinishedException as e:
    print(e)

print("XX")
def wrapper(func):
    def _func(*args):
        try:
            func(*args)
        except FinishedException as e:
            print("[",e,"]为最后一个要执行的case，不执行接下来的操作，退出当前流程")
        except Exception as e:
            print("用例出错:",e)
    return _func

def wrapper_basecase(isfinished="false")
def _func(*args):
     if isfinished == "true":
         raise FinishedException(name)

@wrapper
def A(driver,iteration=2):
    @wrapper_basecase(isfinished="true")
    def B():
        return xxx
    B()

